<?php

require_once ('BaseService.php');

/**
 * @author Virtualidad
 * @version 1.0
 * @created 29-dic-2010 09:57:49 a.m.
 */
class AuthenticationService extends BaseService {

    public function getServiceClass() {
        return "Authentication";
    }

    /**
     *
     * @param CodigoEstudiante
     * @param PeriodoAcademico
     *
     * @return ServiceResponse
     */
    function Login($Username, $Password) {
        $response = parent::invokeService("Login", '{"Username":"' . $Username . '","Password":"' . $Password . '"}');
        require_once ('entities/ServiceResponse.php');
        require_once ('entities/User.php');

        $result = parent::processSingleObjectResponse($response, parent::getMimeType(), "ServiceResponse", array("User" => "User"));
        return $result;
    }
    
    /**
     *
     * @param int $DocumentoIdentidad 
     * 
     */
    function GetByDocumentoIdentidad($DocumentoIdentidad) {
        $response = parent::invokeService("GetByDocumentoIdentidad", $DocumentoIdentidad);
        Loader::using("models::entities::Estudiantes");
        $result = parent::processArrayResponse($response, parent::getMimeType(), "Estudiantes", Estudiantes::MAPPING());
        return $result;
    }

}

?>